package thread;
class Singleton {
     private static Singleton istance = new Singleton();
     public static Singleton getInstance() {
         return istance;
     }
     private Singleton() {

     }
}
public class Demo21 {
    public static void main(String[] args) {
        Singleton s1 = Singleton.getInstance();
        Singleton s2 = Singleton.getInstance();
        System.out.println(s1==s2);
    }
}
